from django.db import models

class Person(models.Model):
    first_name = models.CharField(max_length=50)
    family_name = models.CharField(max_length=100)

    def __unicode__(self):
        return u'%s %s' % (self.first_name, self.family_name)

class ContactType(models.Model):
    name = models.CharField(max_length=100)
    on_page_desc = models.CharField(max_length=100)

    def __unicode__(self):
        return u'%s' % (self.name,) # determines what is visible in foreign kez dropdown

class Contact(models.Model):
    type = models.ForeignKey(ContactType)
    person = models.ForeignKey(Person)
    value = models.CharField(max_length=100)

    def __unicode__(self):
        return u'(%s, %s)' % (self.type, self.value) 










































